Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #36330

Re: Wanted: List of intervals

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Wanted: List of intervals
Date 2017-02-18 20:45 +0000
Organization A noiseless patient Spider
Message-ID <o8abpe$tsc$1@dont-email.me> (permalink)
References (2 earlier) <o85qo5$kpr$1@Gaia.teknon.de> <o86p7j$5ea$1@dont-email.me> <o88v9p$gln$1@Gaia.teknon.de> <o89hiu$fj$2@dont-email.me> <o8a923$qv3$1@Gaia.teknon.de>

Show all headers | View raw


On Sat, 18 Feb 2017 19:58:59 +0000, Volker Borchert wrote:

> Martin Gregorie wrote:
>> On Sat, 18 Feb 2017 08:06:17 +0000, Volker Borchert wrote:
>> 
>> > Martin Gregorie wrote:
>> >> No need of that: the TreeMap class is based on a red-black tree.
>> > 
>> > At least I'd have to subclass it to reasonably implement the
>> > look-at-neighbors-during-addition and to avoid the additional object
>> > overhead for either the $Entry (if using TreeSet<Range>) or two Long
>> > (if using TreeMap<Long,Long>). And even then, the $Entry will still
>> > have three references and one boolean extra. Given that insertion is
>> > O(log n)
>> > with nontrivial constants,
>> >
>> There's no reason why the key Long has to be separate: you can define
>> your own class to hold the long and a boolean and use the long's getter
>> method as the key reference.
> 
> It'll still be an object separate from the TreeSet/TreeMap $Entry and
> have its own two word header and the reference from the $Entry.
(another 400KB 
Fair comment. T'would still be interesting to see how fast it is though.

This is not on your scale, I know, but the biggest TreeMaps I've used so 
far form the basis of a club duty rostering tool I've written which uses 
TreeMaps to organise its various lists: 
- members keyed by name
- roles to be rostered keyed by rolename
- duties to be filled, keyed by member name and date. 

This season its dealing with just under 100 members and 6700 duties sllit 
over six roles. Its a Swing tool. Running on a relatively slow machine 
(Thinkpad laptop running Fedora 25 on a Core Duo clocked at 1.6 GHz) 
there's a barely perceptible pause when switching between roles, each in 
a separate JFrame, but no noticeable delay while assigning and swapping 
duties within a role. Of course, start up takes 7-8 seconds because its 
reading in 400kB of data while setting up its internal structures and 
loading/saving work in progress (another 400 kB read/written) takes 1-2 
seconds.
 

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Wanted: List of intervals v_borchert@despammed.com (Volker Borchert) - 2017-02-16 21:13 +0000
  Re: Wanted: List of intervals Arne Vajhøj <arne@vajhoej.dk> - 2017-02-16 17:11 -0500
    Re: Wanted: List of intervals v_borchert@despammed.com (Volker Borchert) - 2017-02-17 02:49 +0000
      Re: Wanted: List of intervals Arne Vajhøj <arne@vajhoej.dk> - 2017-02-16 22:32 -0500
        Re: Wanted: List of intervals v_borchert@despammed.com (Volker Borchert) - 2017-02-18 07:28 +0000
        Re: Wanted: List of intervals Robert Klemme <shortcutter@googlemail.com> - 2017-02-19 20:02 +0100
          Re: Wanted: List of intervals Arne Vajhøj <arne@vajhoej.dk> - 2017-02-19 17:13 -0500
            Re: Wanted: List of intervals Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-02-19 17:18 -0500
              Re: Wanted: List of intervals Robert Klemme <shortcutter@googlemail.com> - 2017-02-19 23:31 +0100
                Re: Wanted: List of intervals Arne Vajhøj <arne@vajhoej.dk> - 2017-02-19 23:00 -0500
                Re: Wanted: List of intervals Arne Vajhøj <arne@vajhoej.dk> - 2017-02-19 23:09 -0500
              Re: Wanted: List of intervals Arne Vajhøj <arne@vajhoej.dk> - 2017-02-19 22:52 -0500
                Re: Wanted: List of intervals Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-02-20 07:47 -0500
                Re: Wanted: List of intervals Andreas Leitgeb <avl@logic.at> - 2017-02-20 13:30 +0000
                Re: Wanted: List of intervals Arne Vajhøj <arne@vajhoej.dk> - 2017-02-20 08:51 -0500
  Re: Wanted: List of intervals Robert Klemme <shortcutter@googlemail.com> - 2017-02-16 23:18 +0100
    Re: Wanted: List of intervals v_borchert@despammed.com (Volker Borchert) - 2017-02-17 02:54 +0000
  Re: Wanted: List of intervals Martin Gregorie <martin@address-in-sig.invalid> - 2017-02-16 23:58 +0000
    Re: Wanted: List of intervals v_borchert@despammed.com (Volker Borchert) - 2017-02-17 03:30 +0000
      Re: Wanted: List of intervals Martin Gregorie <martin@address-in-sig.invalid> - 2017-02-17 12:10 +0000
        Re: Wanted: List of intervals v_borchert@despammed.com (Volker Borchert) - 2017-02-18 08:06 +0000
          Re: Wanted: List of intervals Martin Gregorie <martin@address-in-sig.invalid> - 2017-02-18 13:18 +0000
            Re: Wanted: List of intervals v_borchert@despammed.com (Volker Borchert) - 2017-02-18 19:58 +0000
              Re: Wanted: List of intervals Martin Gregorie <martin@address-in-sig.invalid> - 2017-02-18 20:45 +0000
              Re: Wanted: List of intervals Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-02-19 10:57 -0500
                Re: Wanted: List of intervals Andreas Leitgeb <avl@logic.at> - 2017-02-19 17:36 +0000
  Re: Wanted: List of intervals a.laforgia@gmail.com - 2017-02-17 03:13 -0800
  Re: Wanted: List of intervals Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-02-17 08:20 -0500
  Re: Wanted: List of intervals Roedy Green <inquiry@mindprod.com> - 2017-03-08 01:30 -0800
    Re: Wanted: List of intervals v_borchert@despammed.com (Volker Borchert) - 2017-03-09 19:32 +0000
      Re: Wanted: List of intervals Andreas Leitgeb <avl@logic.at> - 2017-03-09 23:05 +0000
        Re: Wanted: List of intervals v_borchert@despammed.com (Volker Borchert) - 2017-03-11 01:40 +0000
          Re: Wanted: List of intervals Andreas Leitgeb <avl@logic.at> - 2017-03-11 12:39 +0000
            Re: Wanted: List of intervals v_borchert@despammed.com (Volker Borchert) - 2017-03-11 18:15 +0000
              Re: Wanted: List of intervals Andreas Leitgeb <avl@logic.at> - 2017-03-11 21:47 +0000

csiph-web