由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Simple question
相关主题
Help问一个Collection Update的问题
传递一个object reference,如何防止更改object?java 写unit test 给clover 真就是农民阿
请教关于使用map和fieldshow to solve the problem: the members change by each other .
关于java的范型的问题一个多线程问题
deserializer probelm.Ignore upper. Thx发现java码工有个好处
大家写java class的时候是完全封装的么?Java 里面什么Json库比较好用呀?
What's good way to pass intermediate results?请教两个hadoop的简单问题
spring frame work questionget输出到Json
相关话题的讨论汇总
话题: simple话题: hashmap话题: question话题: structure话题: way
进入Java版参与讨论
1 (共1页)
g**********y
发帖数: 14569
1
What's the most efficient data structure in Java to express:
key -> {key1:value1, key2:value2, ... keyN:valueN}
HashMap is one way. Since I need no operation other than
getter/setter, class is kind of heavy. Anything lighter?
g*****g
发帖数: 34805
2
Class is not heavy, just go ahead, a clean structure is way
better than minimal performance gain.

than

【在 g**********y 的大作中提到】
: What's the most efficient data structure in Java to express:
: key -> {key1:value1, key2:value2, ... keyN:valueN}
: HashMap is one way. Since I need no operation other than
: getter/setter, class is kind of heavy. Anything lighter?

A**o
发帖数: 1550
3
maybe op was doing memory tuning? ^_^

【在 g*****g 的大作中提到】
: Class is not heavy, just go ahead, a clean structure is way
: better than minimal performance gain.
:
: than

m******t
发帖数: 2416
4

You'd be suprised how much more memory efficient a Bean is than a hashmap.
8-)
Unless the keys in OP are dynamic, I'd define a bean class as bug suggested
and do it The Right Way(tm).

【在 A**o 的大作中提到】
: maybe op was doing memory tuning? ^_^
g*****g
发帖数: 34805
5
Usually when we talk about performance, it's about data structure and
algorithm, the efficiency of single unit access, is far less important.
c << logN and we don't care about it until we have to.

suggested

【在 m******t 的大作中提到】
:
: You'd be suprised how much more memory efficient a Bean is than a hashmap.
: 8-)
: Unless the keys in OP are dynamic, I'd define a bean class as bug suggested
: and do it The Right Way(tm).

1 (共1页)
进入Java版参与讨论
相关主题
get输出到Jsondeserializer probelm.Ignore upper. Thx
Re: Confused!大家写java class的时候是完全封装的么?
answer Re: how HashMap/Hashtable compare key?What's good way to pass intermediate results?
[转载] How do I sort a map in Java?spring frame work question
Help问一个Collection Update的问题
传递一个object reference,如何防止更改object?java 写unit test 给clover 真就是农民阿
请教关于使用map和fieldshow to solve the problem: the members change by each other .
关于java的范型的问题一个多线程问题
相关话题的讨论汇总
话题: simple话题: hashmap话题: question话题: structure话题: way